Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: set project endpoint based on the region #1508

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

christyjacob4
Copy link
Member

What does this PR do?

(Provide a description of what this PR does.)

Test Plan

(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)

Related PRs and Issues

(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

Have you read the Contributing Guidelines on issues?

(Write your answer here.)

@coolify-appwrite-org
Copy link

coolify-appwrite-org bot commented Nov 11, 2024

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2024-12-10 01:05:57 CET

@coolify-appwrite-org
Copy link

coolify-appwrite-org bot commented Nov 11, 2024

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2024-12-10 01:05:56 CET

@coolify-appwrite-org
Copy link

coolify-appwrite-org bot commented Nov 11, 2024

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2024-12-10 01:05:52 CET

@coolify-appwrite-org
Copy link

coolify-appwrite-org bot commented Nov 11, 2024

The preview deployment is ready. 🟢

Open Preview | Open Build Logs

Last updated at: 2024-12-10 01:06:17 CET

Comment on lines 5 to 11
export const REGION_FRA = 'fra';
export const REGION_SYD = 'syd';
export const REGION_NYC = 'nyc';

export const SUBDOMAIN_FRA = 'fra.';
export const SUBDOMAIN_SYD = 'syd.';
export const SUBDOMAIN_NYC = 'nyc.';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think we need constants for that, its good enough to have them locally in the sdk.ts

Comment on lines +44 to +55
const getSubdomain = (region?: string) => {
switch (region) {
case REGION_FRA:
return SUBDOMAIN_FRA;
case REGION_SYD:
return SUBDOMAIN_SYD;
case REGION_NYC:
return SUBDOMAIN_NYC;
default:
return '';
}
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const getSubdomain = (region?: string) => {
switch (region) {
case REGION_FRA:
return SUBDOMAIN_FRA;
case REGION_SYD:
return SUBDOMAIN_SYD;
case REGION_NYC:
return SUBDOMAIN_NYC;
default:
return '';
}
};
const getSubdomain = (region?: string) => {
return region ? `${region}.` : '';
};

we should probably avoid hardcoding regions for this in the console.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants